﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListadoRegistradosTutoria.aspx.cs"
    Inherits="Ent.Inscripcion.Presentacion.Administracion.Reportes.ListadoRegistradosTutoria" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Listado de Registrados para las Tutorias</title>
    <ext:ResourcePlaceHolder ID="ResourcePlaceHolder1" runat="server" Mode="Script" />
    <script type="text/javascript" src="../../Resources/Js/EntInscripcion.js"></script>
</head>
<body>
    <form runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" Locale="es" />
    <script type="text/javascript" language="javascript">
    var saveData = function () {
            <%= GridData.ClientID%>.setValue(Ext.encode(<%= gdpRegistrados.ClientID%>.getRowsValues(false)));
        }
    </script>
    <ext:Hidden ID="GridData" runat="server" />
    <ext:Viewport ID="ViewPort1" runat="server" Layout="Fit">
        <LayoutConfig>
            <ext:VBoxLayoutConfig Align="Stretch" />
        </LayoutConfig>
        <Items>
            <ext:Panel ID="Panel2" BodyStyle="background-color:transparent;" Padding="10" Border="false"
                runat="server" ButtonAlign="Center">
                <Items>
                    <ext:FormPanel ID="frpDatosBusqueda" BodyStyle="background-color:transparent;" runat="server"
                        Border="false" Layout="Column" LabelWidth="70" ButtonAlign="Center">
                        <Items>
                            <ext:Panel ID="Panel3" runat="server" ColumnWidth="0.5" Height="80" Border="false"
                                Layout="Form">
                                <Items>
                                    <ext:TextField ID="txtCedula" runat="server" FieldLabel="Cédula" AnchorHorizontal="95%"/>
                                    
                                    <ext:ComboBox ID="cbxDiaB" runat="server" AnchorHorizontal="95%" Editable="false"
                                        DisplayField="Nombre" ValueField="Id" FieldLabel="Día" Mode="Local">
                                        <Store>
                                            <ext:Store runat="server" ID="stoDias">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="Id">
                                                        <Fields>
                                                            <ext:RecordField Name="Id" />
                                                            <ext:RecordField Name="Codigo" />
                                                            <ext:RecordField Name="Nombre" />
                                                            <ext:RecordField Name="Descripcion" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <ToolTips>
                                            <ext:ToolTip ID="ToolTip4" runat="server" Title="Día">
                                            </ext:ToolTip>
                                        </ToolTips>
                                        <Triggers>
                                            <ext:FieldTrigger Icon="Clear" Qtip="Limpiar" />
                                        </Triggers>
                                        <Listeners>
                                            <TriggerClick Handler="this.clearValue();" />
                                        </Listeners>
                                    </ext:ComboBox>
                                    <ext:ComboBox ID="cbxDocente" runat="server" AnchorHorizontal="95%" DisplayField="NombreCompleto"
                                        ValueField="Id" FieldLabel="Docente" Mode="Local" EmptyText="Seleccione.." TypeAhead="false"
                                        LoadingText="Searching..." PageSize="10" HideTrigger="true" MinChars="1">
                                        <Store>
                                            <ext:Store runat="server" ID="stoDocentes">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="Id">
                                                        <Fields>
                                                            <ext:RecordField Name="Id" />
                                                            <ext:RecordField Name="NombreCompleto" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <Triggers>
                                            <ext:FieldTrigger Icon="Clear" Qtip="Limpiar" />
                                        </Triggers>
                                        <Listeners>
                                            <TriggerClick Handler="this.clearValue();" />
                                        </Listeners>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Panel>
                            <ext:Panel ID="Panel6" runat="server" ColumnWidth="0.5" Border="false" Layout="Form">
                                <Items>
                                    <ext:ComboBox ID="cbxOfertaTutorias" runat="server" Editable="false" DisplayField="Nombre"
                                        AllowBlank="true" ValueField="Id" FieldLabel="Periodo" Mode="Local" AnchorHorizontal="95%"
                                        EmptyText="Seleccione..">
                                        <Store>
                                            <ext:Store runat="server" ID="stoOfertaTutorias">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="Id">
                                                        <Fields>
                                                            <ext:RecordField Name="Id" />
                                                            <ext:RecordField Name="Codigo" />
                                                            <ext:RecordField Name="Nombre" />
                                                            <ext:RecordField Name="Descripcion" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <ToolTips>
                                            <ext:ToolTip ID="ToolTip1" runat="server" Title="Nivel de inglés">
                                            </ext:ToolTip>
                                        </ToolTips>
                                    </ext:ComboBox>
                                    <ext:ComboBox ID="cbxNivelB" runat="server" Editable="false" DisplayField="Nombre"
                                        ValueField="Id" FieldLabel="Nivel" Mode="Local" AnchorHorizontal="95%" EmptyText="Seleccione..">
                                        <Store>
                                            <ext:Store runat="server" ID="stoNiveles">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="Id">
                                                        <Fields>
                                                            <ext:RecordField Name="Id" />
                                                            <ext:RecordField Name="Codigo" />
                                                            <ext:RecordField Name="Nombre" />
                                                            <ext:RecordField Name="Descripcion" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <ToolTips>
                                            <ext:ToolTip ID="ToolTip3" runat="server" Title="Nivel de inglés">
                                            </ext:ToolTip>
                                        </ToolTips>
                                        <Triggers>
                                            <ext:FieldTrigger Icon="Clear" Qtip="Limpiar" />
                                        </Triggers>
                                        <Listeners>
                                            <TriggerClick Handler="this.clearValue();" />
                                        </Listeners>
                                    </ext:ComboBox>
                                    <ext:ComboBox ID="cbxParalelo" runat="server" AnchorHorizontal="95%" Editable="false"
                                        DisplayField="Nombre" ValueField="Id" FieldLabel="Paralelo" Mode="Local" EmptyText="Seleccione..">
                                        <Store>
                                            <ext:Store runat="server" ID="stoParalelos">
                                                <Reader>
                                                    <ext:JsonReader IDProperty="Id">
                                                        <Fields>
                                                            <ext:RecordField Name="Id" />
                                                            <ext:RecordField Name="Codigo" />
                                                            <ext:RecordField Name="Nombre" />
                                                            <ext:RecordField Name="Descripcion" />
                                                        </Fields>
                                                    </ext:JsonReader>
                                                </Reader>
                                            </ext:Store>
                                        </Store>
                                        <Triggers>
                                            <ext:FieldTrigger Icon="Clear" Qtip="Limpiar" />
                                        </Triggers>
                                        <Listeners>
                                            <TriggerClick Handler="this.clearValue();" />
                                        </Listeners>
                                    </ext:ComboBox>
                                </Items>
                            </ext:Panel>
                        </Items>
                        <Buttons>
                            <ext:Button ID="btnListar" runat="server" Text="Listar" Icon="Table">
                                <DirectEvents>
                                    <Click Before="return ValidarFormulario(#{frpDatosBusqueda});" OnEvent="btnListar_Click">
                                        <ExtraParams>
                                            <ext:Parameter Name="Oferta" Value="#{cbxOfertaTutorias}.getValue()" Mode="Raw" />
                                            <ext:Parameter Name="Nivel" Value="#{cbxNivelB}.getValue()" Mode="Raw" />
                                            <ext:Parameter Name="Dia" Value="#{cbxDiaB}.getValue()" Mode="Raw" />
                                            <ext:Parameter Name="Paralelo" Value="#{cbxParalelo}.getValue()" Mode="Raw" />
                                            <ext:Parameter Name="Docente" Value="#{cbxDocente}.getValue()" Mode="Raw" />
                                            <ext:Parameter Name="Cedula" Value="#{txtCedula}.getValue()" Mode="Raw"/>
                                        </ExtraParams>
                                        <EventMask Msg="Buscando Registrados" ShowMask="true" />
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
                        </Buttons>
                    </ext:FormPanel>
                </Items>
            </ext:Panel>
            <ext:GridPanel ID="gdpRegistrados" runat="server" StripeRows="true" AutoWidth="true"
                Height="600">
                <Store>
                    <ext:Store runat="server" ID="stoRegistrados">
                        <Reader>
                            <ext:JsonReader IDProperty="IdSolicitudTutoria">
                                <Fields>
                                    <ext:RecordField Name="IdSolicitudTutoria" />
                                    <ext:RecordField Name="Nombre" />
                                    <ext:RecordField Name="Apellidos" />
                                    <ext:RecordField Name="Identificacion" />
                                    <ext:RecordField Name="Email" />
                                    <ext:RecordField Name="Direccion" />
                                    <ext:RecordField Name="Celular" />
                                    <ext:RecordField Name="Telefono" />
                                    <ext:RecordField Name="Imagen" />
                                    <ext:RecordField Name="Carrera" />
                                    <ext:RecordField Name="Estado" />
                                    <ext:RecordField Name="NombrePeriodo" />
                                    <ext:RecordField Name="Nivel" />
                                    <ext:RecordField Name="Dia" />
                                    <ext:RecordField Name="Paralelo" />
                                    <ext:RecordField Name="Aula" />
                                    <ext:RecordField Name="NombreDocente" />
                                    <ext:RecordField Name="EmailDocente" />
                                    <ext:RecordField Name="CelularDocente" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <TopBar>
                    <ext:Toolbar ID="Toolbar3" runat="server">
                        <Items>
                            <ext:Button ID="btnExcel" runat="server" Text="Exportar a Excel" AutoPostBack="true"
                        OnClick="ToExcel" Icon="PageExcel">
                        <Listeners>
                            <Click Fn="saveData" />
                        </Listeners>
                    </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <ColumnModel ID="ColumnModel3" runat="server">
                    <Columns>
                        <ext:TemplateColumn DataIndex="Imagen" Header="Foto">
                            <Template runat="server">
                                <Html>
                                    <img style="width: 60px; height: 45px;" src="../Images/{Imagen}" />
                                </Html>
                            </Template>
                        </ext:TemplateColumn>
                        <ext:Column Header="Identificacion" Width="90" Sortable="true" DataIndex="Identificacion" />
                        <ext:Column Header="Nombre" Width="130" Sortable="true" DataIndex="Nombre" />
                        <ext:Column Header="Apellidos" Width="130" Sortable="true" DataIndex="Apellidos" />
                        <ext:Column Header="Carrera" Width="100" Sortable="true" DataIndex="Carrera" />
                        <ext:Column Header="Mail" Width="100" Sortable="true" DataIndex="Mail" />
                        <ext:Column Header="Celular" Width="100" Sortable="true" DataIndex="Celular" />
                        <ext:Column Header="Nivel" Width="50" Sortable="true" DataIndex="Nivel" />
                        <ext:Column Header="Dia" Width="50" Sortable="true" DataIndex="Dia" />
                        <ext:Column Header="Paralelo" Width="50" Sortable="true" DataIndex="Paralelo" />
                        <ext:Column Header="Aula" Width="50" Sortable="true" DataIndex="Aula" />
                        <ext:Column Header="Nombre Docente" Width="200" Sortable="true" DataIndex="NombreDocente" />
                        <%--<ext:Column Header="Email Docente" Width="100" Sortable="true" DataIndex="EmailDocente" />--%>
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:RowSelectionModel ID="RowSelectionModel3" runat="server" SingleSelect="true">
                    </ext:RowSelectionModel>
                </SelectionModel>
                <LoadMask Msg="Cargando Datos" ShowMask="true" />
            </ext:GridPanel>
        </Items>
    </ext:Viewport>
    <ext:XScript ID="XScript1" runat="server">

    <script type="text/javascript">
        var mostrarImagen = function(ruta)
        {
            #{imgEstudiante}.setImageUrl('../Images/'+ruta);
        };
    </script>
    </ext:XScript>
    </form>
</body>
</html>
